Relational databases are used for storage and retrieval of information. The information is structured in the database as two-dimensional tables of rows and columns. A column heading designates the type of data stored in each column. The information is stored in a non-volatile medium such as a disk array.
Users may access the database information typically by using database management software. The database storage and management software together comprise a database management system, or DBMS. DBMSs may be implemented on a centralized mainframe system, or may be distributed in a client-server network.
The database management software includes specialized commands for accessing the database information. For example, a common command for accessing data is a Structured Query Language (SQL) “select” query. Using the select query, one or more rows from one or more tables of the database may be retrieved.
The database contents are typically stored in a non-volatile storage such as a disk drive. However, during transaction processing, a copy of the data may be stored in a volatile storage, such as a memory or cache. Typically, the data is manipulated while in the cache, then transferred to the storage upon completion of the operation.
Database management systems typically include a number of features, which facilitate database access. These features permit users to retrieve and store information quickly, allow multiple users to access the database simultaneously, and enable the database to grow to a large size without a reduction in performance during database retrievals. For many applications, a high degree of reliability as well as optimum performance are expected.
Transaction management is one important aspect of a DBMS. Concurrency control, or ensuring that multiple users may access and update the database simultaneously, is one aspect of transaction management. Recovery is another priority for transaction management. Particularly where the database is distributed, there may be an increased likelihood that some portion of the database is rendered useless, such as by an unexpected power disruption. Recovery operations decide which transactions are “committed” and which are to be “rolled back” following the disruption.
Recovery generally is performed by keeping track of a transaction somehow, in anticipation of a DBMS failure. For example, a technique known as write-ahead logging (WAL) employs a transaction log to keep track of every action or operation performed on the database. Under the WAL protocol, both the transaction log and the data are updated in volatile storage, such as memory. Upon completion of the transaction, the transaction log is transferred from the volatile storage to stable storage (e.g., a drive) before the data is stored there. Further, the transaction is regarded as “committed” after the transaction log is transferred to stable storage, but before the data is transferred to stable storage. This transfer from volatile to stable storage is known as a “flush.” The WAL protocol allows the DBMS to transfer the data to stable storage at a more convenient time.
During transaction processing, writes to volatile storage (e.g., memory) are more efficient than writes to stable storage (e.g., drive). As transactions are often performed back-to-back as a series of steps, writes of the transaction log to memory may be performed more often, in some cases, than are needed to maintain full recovery capability of the DBMS.
Thus, there is a continuing need to optimize transaction logging operations.